package com.aidex.biz.service;

import com.aidex.biz.domain.Customer;
import com.aidex.biz.domain.JinjianInfo;
import com.aidex.biz.domain.bo.BusinessSetBo;
import com.aidex.biz.domain.vo.*;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.service.BaseService;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

/**
 * 左心房客户推送信息Service接口
 *
 * @author sean
 * @email 2074844820@qq.com
 * @date 2023-04-03
 */
public interface CustomerService extends BaseService<Customer> {

    /**
     * 批量删除左心房客户推送信息
     *
     * @param ids 需要删除的左心房客户推送信息ID集合
     * @return 结果
     */
    public int deleteCustomerByIds(String[] ids);

    /**
     * 获取最大编号
     *
     * @param customer 左心房客户推送信息
     * @return 结果
     */
    public int findMaxSort(Customer customer);

    /**
     * 根据手机查询客户信息
     *
     * @param customer
     * @return
     */
    public boolean findCustomerByphone(Customer customer);
    /**
     * 根据手机查询客户信息
     *
     * @param phone
     * @return
     */
    public Customer findCustomerByphone(String phone);

    /**
     * 保存推送的客户信息
     *
     * @param customer
     * @return
     */
    public Map savePushCustomer(Customer customer);

    /**
     * 自动分配分配客户到用户
     *
     * @param customer
     */
    public void shareCustomer(Customer customer);

    /**
     * 手动分配分配客户到用户
     *
     * @param customer
     */
    public int shareCustomer(Customer customer,SysUser sysUser,Boolean isSms);

    /**
     * 手动分配分配我的客户到用户
     *
     * @param customer
     */
    public int myShareCustomer(Customer customer,SysUser sysUser,Boolean isSms);

    /**
     * 找到下个分配用户
     *
     * @param customer
     * @return
     */
    public SysUser findNextShareUser(Customer customer);

    /**
     * 分配
     *
     * @return
     */
    public void shareCustomerToSysUser(Customer customer);

    /**
     * @return 查询一个为分配的用户
     */
    public Customer findOne();

    /**
     * 导入客户信息
     * @param customers
     * @return
     */
    public String importData(List<Customer> customers,String status) throws InterruptedException;

    /**
     * 修改客户状态
     * @param customer
     * @return
     */
    public Integer updateStatus(Customer customer);

    public Customer findByPhone(Customer customer);

    public PageInfo<Customer> findListXieZu(Customer customer);

    public PageInfo<Customer> findgonghaiList(Customer customer);

    public PageInfo<Customer> findMyList(Customer customer);
    public PageInfo<Customer> findChengJiaoList(Customer customer);
    public PageInfo<Customer> findAllList(Customer customer);

    /**
     * 公海状态
     * @param customer
     * @return
     */
    public Integer updateGongHaiStatus(Customer customer);
    public List<CustomerExpertVo> findAllExportList();

    /**
     * 统计线索成本
     * @param customer
     * @return
     */
    public PageInfo<GuanggaoChengBen> pageGuanggaoChengben(Customer customer);


    /**
     * 广告成本合计
     */
    public HeJiGuanggaoChengBen hejiGuanggaochengben(Customer customer);
    /**
     * 统计线索成本
     * @param customer
     * @return
     */
    public List<GuanggaoChengBen> guanggaoChengben(Customer customer);

    /**
     * 工资统计
     */
    public List<YuanGongGongziVo> yuangonggongzitongji(Customer customer);

    public PageInfo<Customer> ysfindPage(Customer customer);

    /**
     * 已成交客户自动变更设置
     */
    public void updateStatusByJinJianStatus(JinjianInfo jinjianInfo);


    /**
     * /*我的客户48内，没有跟进，去公海   锁住的客户不准去公海
     */
    public void updateStatusToHongHai48(BusinessSetBo businessSetBo);
    /**
     * /*我的客户 15天内，没有跟进  锁住的客户不准去公海
     */
    public void updateStatusToHongHai15(BusinessSetBo businessSetBo);

    /**
     * /*我的客户3天内，没有跟进 锁住的客户不准去公海
     */
    public void updateStatusToHongHai3(BusinessSetBo businessSetBo);

    /**
     *  *线索池内，没有跟进，去公海*
     */
    public void updateStatusToHongHaiXianSuoChi(BusinessSetBo businessSetBo);


    /**
     *  取消标记重复客户
     */
    public void updateStatusCancelRep(BusinessSetBo businessSetBo);
    /**
     * 取消锁定
     */
    public void updateStatusCancelLock(BusinessSetBo businessSetBo);


    /**
     * 查询已经锁客多少人
     */
    public Integer findLocks(Customer customer);


    /**
     * 锁客
     */
    public Integer lockCustomer(Customer customer);


    /**
     *
     * @param businessSetBo
     * @return
     */
    public List<Customer> selectToHongHai48(BusinessSetBo businessSetBo);

    /**
     *
     * @param businessSetBo
     * @return
     */
    public List<Customer> selectToHongHai3(BusinessSetBo businessSetBo);

    /**
     *
     * @param businessSetBo
     * @return
     */
    public List<Customer> selectToHongHai15(BusinessSetBo businessSetBo);



    /**
     *
     * @param businessSetBo
     * @return
     */
    public List<Customer> selectIsRepToTime(BusinessSetBo businessSetBo);

    /**
     *
     * @param businessSetBo
     * @return
     */
    public List<Customer> selectIsLockToTime(BusinessSetBo businessSetBo);

    /**
     *
     * @param jinjianInfo
     * @return
     */
    public List<Customer> selectCustomerIdByJinJianStatus(JinjianInfo jinjianInfo);

    /**
     * 10分钟内未跟进自动转入公海
     * @param businessSetBo
     * @return
     */
    public Customer findNotGen(BusinessSetBo businessSetBo);


    /**
     * 重新分配
     */
    public Integer updateNotGen(Customer customer);

    /**
     *
     * 员工离职 客户转入公海
     * @param ids 员工ID
     * @return
     */
    public int deleteUsersToGongHai(String[] ids);


    /**
     * 融享客入库
     */
    public int insertRongXinKe(String orderNo);

    public Integer updateIsHeart(Customer customer);



}
